//
//  LXFMDBViewController.m
//  kdxf_test
//
//  Created by iOS-01 on 16/11/3.
//  Copyright © 2016年 iOS-01. All rights reserved.
//

#import "LXFMDBViewController.h"
#import "LXDBManager.h"
#import "LXUserModel.h"

@interface LXFMDBViewController ()

@end

@implementation LXFMDBViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)addBtn:(id)sender {
    LXUserModel *model = [[LXUserModel alloc] init];
//    model.userId = 1;
    model.name = @"222";
    model.age = @"23";
    model.image = [UIImage imageNamed:@"1.jpg"];
    [[LXDBManager sharedManager] addUserModel:model];
}

- (IBAction)deleteBtn:(id)sender {
    
}

- (IBAction)changeBtn:(id)sender {
    
}

- (IBAction)searchBtn:(id)sender {
    LXUserModel *model = [[LXDBManager sharedManager] searchAllUsers];
        NSString *userInfoStr = [NSString stringWithFormat:@"name is %@, age is %@",  model.name, model.age];
        NSLog(@"%@", userInfoStr);
}

- (IBAction)createBtn:(id)sender {
}
@end
